<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@taglib prefix="s" uri="/struts-tags"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>我的信息</title>
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<link href="css/bootstrap.min.css" rel="stylesheet" media="screen">
</head>
<body>
	<s:form action="coach_edit" method="post" onsubmit="return check()" name="f1">
		<table class="table table-condensed table-hover table-striped">
			<s:iterator value="jsfcoach" var="var">
			<tr><td>姓名： </td><td>
			<input type="text" name="name" value='<s:property value="#var.name" />'>
			<input type="hidden" value='<s:property value="#var.id" />' name="coachID">
			<font color="red">*</font></td></tr>
			<tr><td>密码： </td><td>
			<input type="text" name="password" />
			<font color="red">*</font></td></tr>
			<tr><td>身份证：</td><td>
			<input type="text" name="idCard" value='<s:property value="#var.idCard" />'>
			<font color="red">*</font></td></tr>
			<tr><td>地址： </td><td>
			<input type="text" name="address" value='<s:property value="#var.address" />'>
			</td></tr>
			<tr><td>出生日期:
			</td><td><input type="date" name="age">
			原日期：<s:property value="#var.age" />
			<font color="red">*</font></td></tr>
				<tr><td width="150">性别： 
					<s:if test="%{#var.sex == 1}">
					<input type="radio" name="sex" value="1" checked="checked"/>男
			    	<input type="radio" name="sex" value="0" />女
					</s:if><s:else>
					<input type="radio" name="sex" value="1" />男
			    	<input type="radio" name="sex" value="0" checked="checked" />女
					</s:else>
				<font color="red">*</font></td></tr>
			<tr><td>电话号码： </td><td>
			<input type="text" name="phoneNum" value='<s:property value="#var.phoneNum" />'>
			<font color="red">*</font></td></tr>
			<tr><td><input type="submit" value="保存" class="btn btn-info"/></td>
			</s:iterator>
		</table>
	</s:form>
	<script type="text/javascript">
    function check(){
		var name = document.f1.name;
		var password = document.f1.password;
		var idCard = document.f1.idCard;
		var age = document.f1.age;
		var phoneNum = document.f1.phoneNum;
		var reNum =/^[0-9]+$/;
		if(name.value==""||password.value==""||idCard.value==""||phoneNum.value==""){
			alert("必填项不能为空！");
			return false;
		}
		if(!reNum.test(phoneNum.value) || !reNum.test(idCard.value)){
			alert("“电话号码、身份证号码、年龄必须为数字！");
			return false;
		}
		
		else{
			return true;
		}
	}
    </script>
</body>
</html>